<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<html>
<head>
	<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
	<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
	<script src="${contextPath}/scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
	<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
<title>盘库管理</title>
<script type="text/javascript">
	function jumpPage(page) {
		var searchForm = document.searchForm;
		searchForm.action = "<s:property value='contextPath'/>/cs/index.do?currentPage=" + page;
		searchForm.submit();
	}

	function operate(name_,id) {
		var searchForm = document.searchForm;
		searchForm.action = "<s:property value='contextPath'/>/cs/"+name_+".do?&entity.id="+id;
		searchForm.submit();
	}
	
	function destory(id) {
		if(confirm("删除盘库无法恢复,确认删除吗?")) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cs/destory.do?currentPage=${currentPage}&entity.id="+id;
			searchForm.submit();
		}	  
	}
</script>
</head>
<body>
<div class="navigation">
  <span>
  <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
   <a href="javascript:window.history.forward();">前进</a>
  <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
   <a href="javascript:window.location.reload();">刷新</a>
  </span>盘库管理&gt;&gt;盘库
</div>

<div class="xt_main_right_center">    
<form name="searchForm" id="searchForm" method="post" action="index.do">
	      <table width="100%" border="0" cellpadding="0" cellspacing="0"  style="border-color:#CCCCCC;">
	         <tr>
	        	<td class="left-td-width-bg"><span>驻店顾问:</span> </td>
	        	<td>
	           		<input type="text" name='search.shopUser.realName'  class="input" value="<s:property value="search.shopUser.realName"/>"  style='width:120px'/>
	            </td>
	            <td class="left-td-width-bg"><span>店号:</span> </td>
	            <td>
	            	<input type="text" name='search.shop.shopMark'  class="input"  value="<s:property value="search.shop.shopMark"/>"  style='width:120px'/>
	            </td>
	            <td class="left-td-width-bg"><span>盘库时间:</span></td>
	            <td>
	            	<input name="search.createdAt" id="checkStockDateBegin"  class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.createdAt" format="yyyy-MM-dd"/>"  onblur="checkdate(this,document.getElementById('checkStockDateEnd'))"/>
	            	至 <input name="search.updatedAt" id="checkStockDateEnd" class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.updatedAt" format="yyyy-MM-dd"/>"  onblur="checkdate(document.getElementById('checkStockDateBegin'),this)"/>
	            </td>
	        </tr>
	         <tr>
	        	<td class="left-td-width-bg"><span>区域经理:</span> </td>
	        	<td>
	           		<input type="text" name='search.areaManager.realName'  class="input"  value="<s:property value="search.areaManager.realName"/>"  style='width:120px'/>
	            </td>
	            <td class="left-td-width-bg"><span>状态:</span></td>
	            <td> 
	            	<s:select name="status" list="@com.jysz.certificate.persistence.enums.cs.CheckStockStatus@values()"  theme="simple" listKey="index" listValue="name" headerKey="-1" headerValue="--请选择--" value="status"></s:select>
	            </td>
	            <td class="left-td-width-bg"><span>盘库结果:</span></td>
	            <td> 
	            	<select name="success">
	            		<option value="0">--请选择--</option>
	            		<option value="1" <s:if test="success==1">selected="selected"</s:if>>成功</option>
	            		<option value="2" <s:if test="success==2">selected="selected"</s:if>>失败</option>
	            	</select>
	            </td>
	        </tr>
	         <tr style="background:url(${contextPath}/images/xt_main_right_dhbj.jpg) repeat-x;">
	            <td colspan="6" align="right" style="padding-right: 120px">
	            	&nbsp;&nbsp;<input type="button" class="btn_clear_form" onclick="clearForm(this.form);return false;"/>
	            	&nbsp;&nbsp;<input id='sousuo' type="submit" value=""  class="btn_query"/>
	            </td>
	        </tr>
	      </table>
      </form>
</div> 
<br/>
 <table width="100%" border="0" cellpadding="0" cellspacing="0">
	     <tr>
	       <td height="25" align="left"><font color="#0066CC"><strong>盘库列表：</strong></font></td>
	       <td height="25" align="right">
	       <jysz:permission code="CS_ADD">
	          <a href="add.do"><img src="${contextPath}/images/btn_add.png" alt="新增盘库" /></a>
			</jysz:permission>
	       </td>
	     </tr>
  </table> 
      
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
  <tr> 
	    <td width="3%" class="top-td-width-bg">序号</td>
	    <td width="9%" class="top-td-width-bg">店号</td>
	    <td width="9%" class="top-td-width-bg">店名</td>
	    <td width="9%" class="top-td-width-bg">驻店顾问</td>
	    <td width="9%" class="top-td-width-bg">区域经理</td>
	    <td width="9%" class="top-td-width-bg">盘库人</td>
	    <td width="8%" class="top-td-width-bg">状态</td>
	    <td width="8%" class="top-td-width-bg">盘库结果</td>
	    <td width="9%" class="top-td-width-bg">盘库时间</td>
	    <td width="9%" class="top-td-width-bg">方式</td>
	    <td width="9%" class="top-td-width-bg">来源</td>
	    <td width="10%" class="top-td-width-bg">操作</td>
	</tr>
 	<s:iterator value="page.result" status="st">
		<tr>
			<td  class="down-center-td-width-bg">
				<s:property value="#st.index+1"/>
			</td>
			<td  class="down-center-td-width-bg">
				<s:property value="shop.shopMark" />
			</td>
			<td  class="down-center-td-width-bg">
				<s:property value="shop.shopName" />
			</td>
			<td  class="down-center-td-width-bg">
				<s:property value="shopUser.realName" />
			</td>
			<td  class="down-center-td-width-bg">
				<s:property value="areaManager.realName" />
			</td>
			<td  class="down-center-td-width-bg">
				<s:property value="sponsor.realName" />
			</td>
			<td  class="down-center-td-width-bg">
				<s:property value="status.name" />
			</td>
			<td  class="down-center-td-width-bg">
				<s:if test="success!=null">
					<s:if test="success" >成功</s:if>
					<s:if test="!success" >失败</s:if>
				</s:if>
			</td>
			<td  class="down-center-td-width-bg"><s:date name="finishDate" format="yyyy-MM-dd" /></td>
			<td  class="down-center-td-width-bg"><s:if test="live">现场</s:if><s:else>非现场</s:else></td>
			
			<td  class="down-center-td-width-bg"><s:property value="source.name" /></td>
			
			<td  class="down-center-td-width-bg">
				<a href="javascript:operate('view',<s:property value="id"/>);" title="详情"><img src="${contextPath}/images/chakan.gif" alt="详情" width="16" height="18" border="0" /></a>&nbsp;
				<s:if test="status.index==0&&sponsor.id==user.id">
				<%-- <jysz:permission code="CS_EDIT">
					<a href="javascript:operate('edit',<s:property value="id"/>);"  title="编辑"><img src="${contextPath}/images/edit.gif" alt="编辑" width="16" height="18" border="0" /></a>
				</jysz:permission> --%>
				</s:if>
				
				<%-- <s:if test="@com.jysz.certificate.persistence.enums.cs.CheckStockStatus@SUBMITED.equals(status)">
					<jysz:permission code="CS_CONFIRM_SHOP">
						<a href="javascript:operate('preConfirm',<s:property value="id"/>);" title="确认盘库"><img src="${contextPath}/images/audit.png" alt="确认" width="16" height="18" border="0" /></a>
					</jysz:permission>
				</s:if> --%>
				<s:if test="@com.jysz.certificate.persistence.enums.cs.CheckStockStatus@UNSTART.equals(status)">
					<jysz:permission code="CS_CONFIRM_AREA">
						<a href="javascript:operate('preConfirm',<s:property value="id"/>);" title="确认盘库"><img src="${contextPath}/images/edit.gif" alt="编辑" width="16" height="18" border="0" /></a>
					</jysz:permission>
				</s:if>
				<s:if test="status.index<3&&sponsor.id==user.id">
				<jysz:permission code="CS_DEL">
					<a href="javascript:destory(<s:property value="id"/>);" title="删除"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
				</jysz:permission>
				</s:if>
			</td>
		</tr>
	</s:iterator>
	<tr> 
	 <td height="36" colspan="12" class="down-center-td-width-bg" align="right">
			<%@ include file="/WEB-INF/view/common/pagination.jsp"%>
 		</td>
	</tr>
</table>


	<br/><br/><br/><br/><br/>
	<div align="center"><jsp:include page="/include/footer.inc"></jsp:include></div>
</body>
</html>